-- GENERATED SPELL FOR [Vilebranch Witch Doctor] --


function spell0_2640(pUnit, Event) --@Healing Wave,Heal--
pUnit:FullCastSpellOnTarget(8005,pUnit)
pUnit:RegisterEvent('Sorts_2640', 3000, 1)
end

function spell1_2640(pUnit, Event) --@Hex,n/a--
pUnit:FullCastSpellOnTarget(18503,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2640', 10273, 1)
end

function spell2_2640(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(9613,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2640', 3000, 1)
end

function Sorts_2640(pUnit, Event)
local choix_sorts_2640 = math.random(0, 2)
if choix_sorts_2640 == 0 then
pUnit:RegisterEvent('spell0_2640', 1, 1)
end
if choix_sorts_2640 == 1 then
pUnit:RegisterEvent('spell1_2640', 1, 1)
end
if choix_sorts_2640 == 2 then
pUnit:RegisterEvent('spell2_2640', 1, 1)
end
end

function mob2640_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_2640', math.random(1500, 3000), 1)
end

function mob2640_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2640_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2640_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(2640, 1, 'mob2640_Action')
RegisterUnitEvent(2640, 2, 'mob2640_Leave')
RegisterUnitEvent(2640, 3, 'mob2640_Kill')
RegisterUnitEvent(2640, 4, 'mob2640_Die')
